import { Opt } from '__com/Opt.js'
import moment from 'moment'

export class searchOpt extends Opt {
  constructor(vm) {
    super(vm)
  }

  create() {
    return [
      {
        title: '日期',
        placeholder: '请选择日期',
        xl: 7,
        key: 'time',
        date: {
          type: 'daterange',
          clearable: false
        },
        data: {
          from: (info) => {
            return [info.startDate, info.endDate]
          },
          to: (v) => {
            return {
              startDate: v[0],
              endDate: v[1]
            }
          }
        }
      }
    ]
  }
}
